<template>
	<view class="video-container">
		<u-navbar-home :bgColor="bgColor">
			<template #left>
				<view class="title u-flex-y-center" style="color: #fff">
					<u-image :src="logo" width="80rpx" height="80rpx"></u-image>
					<view style="width: 10rpx"> </view>
					山西饲草收储交易中心
				</view>
			</template>
		</u-navbar-home>
		<getdatascrollview ref="getdatascrollview" :api="api" :seardata="searchdata" :customStyle="scrollviewstyle">
			<template #default="{ list }">
				<!-- l3087lz91yk -->
				<!-- 	<player-component id="tvp-id" playerid="tvp" vid="l3087lz91yk">

				</player-component> -->
				<!-- {{ list }} -->
				<view class="goodslist">
					<goodsitem v-for="(item, key) in list" :dicts="dicts" type="video" :item="item"
						:levelTypeList="levelTypeList"></goodsitem>
				</view>
			</template>
		</getdatascrollview>
		<tabbar></tabbar>
	</view>
</template>

<script>
	import logo from "@/static/logo.png";

	import {
		getReleaseVideoPage
	} from "@/api/release.js";
	import {
		getDicts
	} from "@/api/dictdata";
	import {
		getProductClassAll
	} from "@/api/index.js";
	export default {
		data() {
			return {
				logo,
				bgColor: "#39C03E",
				api: getReleaseVideoPage,
				searchdata: {
					// hasVideo: 1,
				},
				scrollviewstyle: {
					height: `calc(100vh - 140rpx - ${uni.$u.addUnit(
          uni.$u.getPx(uni.$u.props.navbar.height) +
          uni.$u.sys().statusBarHeight,
          "px"
        )})`,
				},
				dicts: {},
				levelTypeList: [],
			};
		},
		mounted() {
			this.init();
		},
		methods: {
			async init() {
				const res = await getProductClassAll();
				this.levelTypeList = res.data;
				let {
					data
				} = await getDicts("transactional_mode,manage_model");

				let transactional_mode = data.filter((e) => {
					return e.dictType == "transactional_mode";
				});
				let manage_model = data.filter((e) => {
					return e.dictType == "manage_model";
				});

				this.dicts = {
					transactional_mode,
					manage_model,
				};
			},
		},
	};
</script>

<style lang="scss" scoped>
	.video-container {

		//   height: 100vh;
		//   display: flex;
		//   flex-direction: column;
		.goodslist {
			display: flex;
			justify-content: space-between;
			flex-wrap: wrap;
			padding: 0 20rpx;
		}
	}
</style>